#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui->setupUi(this);

    ui->lcdNumber->display(num);


    QTimer *timer = new QTimer(this);
//    timer->setInterval(1000);

    connect(timer,SIGNAL(timeout(void)),this,SLOT(func1(void)));
    timer->start(1000);

}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::func1()
{
//    QDateTime *dt = new QDateTime(QDateTime::currentDateTime());
//    qDebug() << dt->date().toString() << endl;
//    ui->dtLabel->setText(dt->date().toString());

    num++;

    ui->lcdNumber->display(num);

}

